package org.bai.meetingfilm.common.vo;

import org.bai.meetingfilm.exception.CommonServiceException;

import java.util.StringJoiner;

/**
 * @ClassName BasePages
 * @Description 分页请求封装类
 * @Author bai
 * @Date 2021/7/18 17:57
 * @Version 1.0
 **/
public class BasePageReqVO extends BaseRequestVO {

    private Integer nowPage;
    private Integer pageSize;

    public Integer getNowPage() {
        return nowPage;
    }

    public void setNowPage(Integer nowPage) {
        this.nowPage = nowPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    @Override
    public void checkParam() throws CommonServiceException {

    }

    /**
     * @description: 分页信息默认生成方法， 当前页： 1, 每页数据: 10
     * @return: {@link BasePageReqVO }
     * @author: bai
     * @date: 2021/7/18 18:01
     */
    public static BasePageReqVO build() {
        return new BasePageReqVO(1, 10);
    }

    public BasePageReqVO() {
        this.nowPage = 1;
        this.pageSize = 10;
    }

    public BasePageReqVO(Integer nowPage, Integer pageSize) {
        this.nowPage = nowPage;
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", BasePageReqVO.class.getSimpleName() + "[", "]")
                .add("nowPage=" + nowPage)
                .add("PageSize=" + pageSize)
                .toString();
    }
}
